import Mock from 'mockjs'
import AuthApi from './modules/auth'
import UtilsApi from './modules/utils'
import MapApi from './modules/map'
// 修复在使用 MockJS 情况下，设置 withCredentials = true，且未被拦截的跨域请求丢失 Cookies 的问题
// https://github.com/nuysoft/Mock/issues/300
Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send
Mock.XHR.prototype.send = function() {
  if (this.custom.xhr) {
    this.custom.xhr.withCredentials = this.withCredentials || false
  }
  this.proxy_send(...arguments)
}

//账号相关
// Mock.mock('auth/info', 'get', AuthApi.loginInfo)
// Mock.mock('auth/login', 'post', AuthApi.login)
Mock.mock('auth/logout', 'post', AuthApi.logout)
//公共接口
Mock.mock(/utils\/region?/, 'get', UtilsApi.fetchRegion)
//地图
Mock.mock(/mapSite\/companies?/, 'get', MapApi.fetchMapCompanies)
Mock.mock('/api/companyMap/geometries','get',{
  
})
export default Mock
